<?php


namespace IDock\Insurance\YAIC;

use IDock\Http\Response;
use IDock\IDock\IDockInterface;
use IDock\Insurance\YAIC\Request\VehicleModelRequest;
use IDock\Insurance\YAIC\Request\CVehicleActualValueRequest;
use IDock\Insurance\YAIC\Request\PremiumInquiryRequest;
use IDock\Insurance\YAIC\Request\UnderwritingRequest;
use IDock\Insurance\YAIC\Request\UploadFileRequest;
use IDock\Insurance\YAIC\Request\PolicyPaymentRequest;
use IDock\Insurance\YAIC\Request\EPolicyDownloadRequest;
use IDock\Insurance\YAIC\Request\INonCarProductListRequest;
use IDock\Insurance\YAIC\Request\J1ProposalStatusRequest;
use IDock\Insurance\YAIC\Request\J2ProposalRecallRequest;
use IDock\Insurance\YAIC\Request\K1PolicyStatusRequest;
use IDock\Insurance\YAIC\Request\K2PolicyRecallRequest;
use IDock\Insurance\YAIC\Request\ValidateCarRequest;
use IDock\Insurance\YAIC\Response\VehicleModelResponse;
use IDock\Insurance\YAIC\Response\CVehicleActualValueResponse;
use IDock\Insurance\YAIC\Response\PremiumInquiryResponse;
use IDock\Insurance\YAIC\Response\UnderwritingResponse;
use IDock\Insurance\YAIC\Response\UploadFileResponse;
use IDock\Insurance\YAIC\Response\PolicyPaymentResponse;
use IDock\Insurance\YAIC\Response\EPolicyDownloadResponse;
use IDock\Insurance\YAIC\Response\INonCarProductListResponse;
use IDock\Insurance\YAIC\Response\J1ProposalStatusResponse;
use IDock\Insurance\YAIC\Response\J2ProposalRecallResponse;
use IDock\Insurance\YAIC\Response\K1PolicyStatusResponse;
use IDock\Insurance\YAIC\Response\K2PolicyRecallResponse;
use IDock\Insurance\YAIC\Response\ValidateCarResponse;
use IDock\Printer\VehicleActualValuePrinter;
use IDock\Visitor\EPolicyDownloadVisitor;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\NonCar\NonCarProductListVisitor;
use IDock\Visitor\PolicyInfoVisitor;
use IDock\Visitor\PolicyPaymentVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\ProposalRecallVisitor;
use IDock\Visitor\ProposalStatusVisitor;
use IDock\Visitor\RenewalInquiryVisitor;
use IDock\Visitor\UnderwritingRecallVisitor;
use IDock\Visitor\UploadFileVisitor;
use IDock\Visitor\ValidateCarVisitor;
use IDock\Visitor\VehicleActualValueVisitor;
use IDock\Visitor\VehicleModelVisitor;

class YAICConstruct extends Builder implements IDockInterface
{
    public $config = [];

    public function __construct($config)
    {
        $this->config = $config;

        $this->consumerID = $config['consumerID'] ?? '';
        $this->secretKey = $config['secretKey'] ?? '';
        $this->notifyUrl = $config['notifyUrl'] ?? '';
    }

    /**
     * 续保查询
     * @param RenewalInquiryVisitor $renewalInquiryVisitor
     * @return
     */
    public function renewalInquiry(RenewalInquiryVisitor $renewalInquiryVisitor)
    {

    }

    /**
     * 车型查询
     * @param VehicleModelVisitor $vehicleModelVisitor
     * @return VehicleModelResponse
     */
    public function vehicleModel(VehicleModelVisitor $vehicleModelVisitor): VehicleModelResponse
    {
        $request = new VehicleModelRequest();
        $request->setVisitor($vehicleModelVisitor);
//        global $testResponse;
//        $testResponse = '<ResponseData>  <responseHead>    <seqNo>ed4bbe1508f15da7dedffa0fe02d502d</seqNo>    <status>0</status>    <appCode>000000</appCode>    <appMessage>车型查询成功！</appMessage>  </responseHead>  <responseBody> 	  <licenseNo>川A9HG25</licenseNo>      <licenseType></licenseType>      <enrollDate>2017-11-04</enrollDate>      <transferDate></transferDate>      <frameNo>LVVDC11B8HD155520</frameNo>      <engineNo>AAHH63077</engineNo>      <queryModelNo>25110409090803946701131Z</queryModelNo>      <validDate>2025-11-05 09:09:08</validDate>      <carModel>        <CarModelDTO>            <modelCode>QRABDD0005</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201603</marketYear>			<replacementValue>55900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 领潮版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0018</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201703</marketYear>			<replacementValue>57900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 时尚版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0021</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201703</marketYear>			<replacementValue>64900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 尊贵版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0011</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201610</marketYear>			<replacementValue>66900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 领跑版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0006</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201603</marketYear>			<replacementValue>71900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 领臻版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0020</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201703</marketYear>			<replacementValue>60900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 豪华版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0001</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201603</marketYear>			<replacementValue>61900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 领锐版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>        <CarModelDTO>            <modelCode>QRABDD0019</modelCode>            <modelName>奇瑞SQR7150J602轿车</modelName>            <brandCN>奇瑞牌</brandCN>            <series>艾瑞泽5</series>            <importFlag>国产</importFlag>            <ratedPassengerCapacity>5</ratedPassengerCapacity>			<displacement>1.499</displacement>            <marketYear>201703</marketYear>			<replacementValue>58900</replacementValue>	  		<vehicleDescription></vehicleDescription>	  		<refCode1></refCode1>	  		<refCode2></refCode2>	  		<gearboxType>手动档</gearboxType>	  		<remark>手动档 精英版 国Ⅴ</remark>	  		<fuelType>0</fuelType>			<wholeWeight>1265</wholeWeight>			<powerScale>85</powerScale>  			<vehicleJingyou>  				<newVehicleClass>紧凑型轿车(A)</newVehicleClass>  				<newVehicleClassCode>JC03</newVehicleClassCode>                <topSpeed></topSpeed>                <qtfullweight></qtfullweight>            </vehicleJingyou>      </CarModelDTO>    </carModel>  </responseBody></ResponseData>';
        /*** @var VehicleModelResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 车辆实际价格
     * @param VehicleActualValueVisitor $vehicleActualValueVisitor
     * @return CVehicleActualValueResponse
     */
    public function vehicleActualValue(VehicleActualValueVisitor $vehicleActualValueVisitor): CVehicleActualValueResponse
    {
        $response = new CVehicleActualValueResponse();
        $response->setCode(200);
        $response->printer = new VehicleActualValuePrinter();
        $response->printerInit();
        return $response;
    }

    /**
     * 询价前置
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return void
     */
    public function preInquiry(PremiumInquiryVisitor $premiumInquiryVisitor)
    {
    }

    public function validateCar(PremiumInquiryVisitor $premiumInquiryVisitor): Response
    {
        return new Response(200);
    }

    /**
     * 询价
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return PremiumInquiryResponse
     */
    public function premiumInquiry(PremiumInquiryVisitor $premiumInquiryVisitor): PremiumInquiryResponse
    {
        $request = new PremiumInquiryRequest;
        $request->setVisitor($premiumInquiryVisitor);
//        global $testResponse;
//        $testResponse = '<ResponseData>  <responseHead>    <seqNo>c43d46043fa88e24d0d6941ed326946f</seqNo>    <status>0</status>    <appCode>000000</appCode>    <appMessage>精确报价成功！</appMessage>  </responseHead>  <responseBody>  	<reinsureFlag>0</reinsureFlag>    <jqStartDate>2025-11-06 00:00:00</jqStartDate>    <jqEndDate>2026-11-05 23:59:59</jqEndDate>    <syStartDate>2025-11-06 00:00:00</syStartDate>    <syEndDate>2026-11-05 23:59:59</syEndDate>    <queryPastDate>2025-11-15 15:42</queryPastDate>    <queryBZPastDate></queryBZPastDate>    <quotationNoBI>151250336001917778</quotationNoBI>    <quotationNoCI></quotationNoCI>    <operateDate>2025-11-05 15:11:48</operateDate>	<sumAmount>2100988.8</sumAmount>	<sumPremium>3605.99</sumPremium>	<biPremium>3605.99</biPremium>	<ciPremium></ciPremium>	<sumProfit>-1202</sumProfit>	<payTax></payTax>	<benchmarkTax></benchmarkTax>	<taxOverdue></taxOverdue>	<surCharge></surCharge>	<sumTax></sumTax>    <kinds>      <KindDTO>        <kindCode>030006</kindCode>		<amount>50988.8</amount>		<basePremium>1471.24</basePremium>		<premium>2206.86</premium>        <ismaincvrg>0</ismaincvrg>      </KindDTO>      <KindDTO>        <kindCode>030018</kindCode>		<amount>2000000</amount>		<basePremium>832.67</basePremium>		<premium>1249</premium>        <ismaincvrg>0</ismaincvrg>      </KindDTO>      <KindDTO>        <kindCode>030001</kindCode>		<amount>10000</amount>		<basePremium>28.29</basePremium>		<premium>42.44</premium>        <ismaincvrg>0</ismaincvrg>      </KindDTO>      <KindDTO>        <kindCode>030009</kindCode>		<amount>40000</amount>		<basePremium>71.79</basePremium>		<premium>107.69</premium>        <ismaincvrg>0</ismaincvrg>      </KindDTO>      <KindDTO>        <kindCode>033609</kindCode>		<amount>0</amount>		<basePremium>0</basePremium>		<premium>0</premium>        <ismaincvrg>1</ismaincvrg>      </KindDTO>    </kinds>	<extendInfo>			<ExtendInfoDTO>			<key>querySequenceNo</key>			<value>V0101YAIC510025110992328535226</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>rebateRate</key>			<value>0.0</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>dangerConditions</key>			<value>0</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>coverageCI</key>			<value>false</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>relationType</key>			<value>4</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>deepPriceGradeBI</key>			<value>83</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>actualValue</key>			<value>50988.8</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>crenewtypCI</key>			<value>1</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>crenewtypBI</key>			<value>1</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>maxFeeSaleChangeGradeA4</key>			<value>0</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>syFeeSaleChangeRateA4</key>			<value>0.0</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>jqFeeSaleChangeRateA4</key>			<value>0.0</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>basePriceGTLow</key>			<value>true</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>nirrratio</key>			<value>1.5</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>pricingAdjustValue</key>			<value>1.5</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>peccancyadjustvalue</key>			<value>0.0</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>priTranche</key>			<value>12</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>priScore</key>			<value>40.88</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>agencyName</key>			<value>成都衡信业保险代理有限公司武侯营业部</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>branchName</key>			<value>业务一部专代团队1</value>		  </ExtendInfoDTO>			<ExtendInfoDTO>			<key>businessSource</key>			<value>1900203001</value>		  </ExtendInfoDTO>	</extendInfo>    <chargingPilePrms>    </chargingPilePrms>	<FeeCmpMarg>        <jqFeeASum></jqFeeASum>        <syFeeASum></syFeeASum>        <feeASum>18.5</feeASum>        <compensationRate>82.6</compensationRate>        <marginRate>101.1</marginRate>        <marginRateUW>101.1</marginRateUW>        <syFeeUWChangeLowLimit>-18.5</syFeeUWChangeLowLimit>        <jqFeeUWChangeLowLimit>0.0</jqFeeUWChangeLowLimit>        <syFeeUWChangeHighLimit>10.0</syFeeUWChangeHighLimit>        <jqFeeUWChangeHighLimit>0.0</jqFeeUWChangeHighLimit>    </FeeCmpMarg>  </responseBody></ResponseData>';

        /*** @var PremiumInquiryResponse $response */
        $response = $this->execute($request);
        if($response->isSuccess() && $response->printer->success){
            $response->buildCoverage($premiumInquiryVisitor->getVehicleVisitor()->isNewEnergy, $premiumInquiryVisitor->getCoverageVisitorList());
        }
        return $response;
    }

    /**
     * 核保
     * @param PremiumInquiryVisitor $premiumInquiryVisitor
     * @return UnderwritingResponse
     */
    public function underwriting(PremiumInquiryVisitor $premiumInquiryVisitor): UnderwritingResponse
    {
        $request = new UploadFileRequest();
        $list = $premiumInquiryVisitor->fileList;
        $uploadImageNos = [];

        foreach ($list as $val) {
            $visitor = new UploadFileVisitor();
            $visitor->argc = $premiumInquiryVisitor->getExtInfoVisitor()->argc;
            $visitor->argc['uploadImageNo'] =   substr(md5(uniqid().mt_rand(1000,9999)),0,22);
            $visitor->ciInquiryNo = $premiumInquiryVisitor->getUnderwritingVisitor()->ciInquiryNo;
            $visitor->biInquiryNo = $premiumInquiryVisitor->getUnderwritingVisitor()->biInquiryNo;
            $visitor->fileAppend($val['type'], $val['url'], $val['base64']);
            $request->setVisitor($visitor);
            $response = $this->execute($request);
            $uploadImageNos[] = $visitor->argc['uploadImageNo'];
            usleep(50000);
        }
//        global $testResponse;
//        $testResponse = '<ResponseData>  <responseHead>    <seqNo>8b3b61e830220984a4a089d26b686945</seqNo>    <status>0</status>    <appCode>000000</appCode>    <appMessage>下单成功！</appMessage>  </responseHead>  <responseBody>      <proposalNo>251012503060001194</proposalNo>      <proposalBZNo>251012503010001220</proposalBZNo>      <payApp>2825112500024844</payApp>      <proposalInfo>      </proposalInfo>      <extendInfo>              <ExtendInfoDTO>                  <key>payAppNo</key>                  <value>253507011523</value>              </ExtendInfoDTO>              <ExtendInfoDTO>                  <key>payUrl</key>                  <value>http://t.yaic.com.cn:12003/02/253507011523</value>              </ExtendInfoDTO>              <ExtendInfoDTO>                  <key>payUrlApp</key>                  <value>http://t.yaic.com.cn:12003/01/253507011523</value>              </ExtendInfoDTO>      </extendInfo>  </responseBody></ResponseData>';
        $request = new UnderwritingRequest();
        $premiumInquiryVisitor->getExtInfoVisitor()->argc['uploadImageNos'] = $uploadImageNos;
        $request->notifyUrl = $this->notifyUrl;
        $request->setVisitor($premiumInquiryVisitor);
        /*** @var UnderwritingResponse $response */
        $response = $this->execute($request);

        return $response;
    }

    /**
     * 文件上传
     * @param UploadFileVisitor $uploadFileVisitor
     * @return UploadFileResponse
     */
    public function uploadFile(UploadFileVisitor $uploadFileVisitor): UploadFileResponse
    {
        $response =   new UploadFileResponse(200,[]);
        $response->printerInit();
        return $response;
    }

    /**
     * 支付
     * @param PolicyPaymentVisitor $paymentVisitor
     * @return PolicyPaymentResponse
     */
    public function policyPayment(PolicyPaymentVisitor $paymentVisitor): PolicyPaymentResponse
    {
//        global $testResponse;
//        $testResponse = '<ResponseData>  <responseHead>    <seqNo>36f7e8ab0c69eeaee09fbc046b0e22b5</seqNo>    <status>0</status>    <appCode>000000</appCode>    <appMessage>电子投保签署发起请求成功！</appMessage>  </responseHead>  <responseBody>	<errorCode>0000</errorCode>	<errorMessage>验证通过</errorMessage>	<signedAddress>https://uat-wxmall.yaic.com.cn/ele-insure/#/?businessNo=25101250301000122001</signedAddress>  </responseBody></ResponseData>';

        $request = new PolicyPaymentRequest();

        $request->setVisitor($paymentVisitor);

        /*** @var PolicyPaymentResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 电子保单下载
     * @param EPolicyDownloadVisitor $EPolicyVisitor
     * @return EPolicyDownloadResponse
     */
    public function EPolicyDownload(EPolicyDownloadVisitor $EPolicyVisitor): EPolicyDownloadResponse
    {
//        global $testResponse;
//        $testResponse = '<ResponseData>  <responseHead>    <seqNo></seqNo>    <status>0</status>    <appCode>000000</appCode>    <appMessage>成功</appMessage>  </responseHead>  <responseBody>  	<resultCode>0</resultCode>  	<insurancePolicy>JVBERi0xLjcKJeLjz9MKMSAwIG9iago8PClJUVPRgo=</insurancePolicy>  	<errorMessage>成功</errorMessage>  </responseBody></ResponseData>';
        $request = new EPolicyDownloadRequest();
        $request->setVisitor($EPolicyVisitor);

        /*** @var EPolicyDownloadResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 驾意险列表
     * @param NonCarProductListVisitor $nonCarProductListVisitor
     * @return INonCarProductListResponse
     */
    public function nonCarProductList(NonCarProductListVisitor $nonCarProductListVisitor): INonCarProductListResponse
    {

        $request = new INonCarProductListRequest();
        $request->setVisitor($nonCarProductListVisitor);

        /*** @var INonCarProductListResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 投保单状态查询
     * @param ProposalStatusVisitor $proposalStatusVisitor
     * @return J1ProposalStatusResponse
     */
    public function proposalStatus(ProposalStatusVisitor $proposalStatusVisitor): J1ProposalStatusResponse
    {
        $request = new J1ProposalStatusRequest();
        $request->setVisitor($proposalStatusVisitor);

        /*** @var J1ProposalStatusResponse $response */
        $response = $this->execute($request);

        return $response;
    }

    /**
     * 投保单撤单接口
     * @param ProposalRecallVisitor $revokeVisitor
     * @return J2ProposalRecallResponse
     */
    public function proposalRecall(ProposalRecallVisitor $revokeVisitor): J2ProposalRecallResponse
    {
        $request = new J2ProposalRecallRequest();
        $request->setVisitor($revokeVisitor);

        /*** @var J2ProposalRecallResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 保单状态
     * @param PolicyInfoVisitor $policyInfoVisitor
     * @return K1PolicyStatusResponse
     */
    public function policyInfo(PolicyInfoVisitor $policyInfoVisitor): K1PolicyStatusResponse
    {
        $request = new K1PolicyStatusRequest();
        $request->setVisitor($policyInfoVisitor);

        /*** @var K1PolicyStatusResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    /**
     * 人工核保撤回
     * @param UnderwritingRecallVisitor $recallVisitor
     * @return K2PolicyRecallResponse
     */
    public function underwritingRecall(UnderwritingRecallVisitor $recallVisitor): K2PolicyRecallResponse
    {
        $request = new K2PolicyRecallRequest();
        $request->setVisitor($recallVisitor);

        /*** @var K2PolicyRecallResponse $response */
        $response = $this->execute($request);
        return $response;
    }

    public function nonCarInquiry(NonCarInquiryVisitor $nonCarInquiryVisitor): Response
    {
        return new Response(200);
    }

    public function nonCarUnderwriting(NonCarInquiryVisitor $inquiryPrinter): Response
    {
        return new Response(200);
    }

    /**
     * 验车码
     * @param ValidateCarVisitor $validateCarVisitor
     * @return ValidateCarResponse
     */
    public function validateCarCode(ValidateCarVisitor $validateCarVisitor): ValidateCarResponse
    {
        $request = new ValidateCarRequest();
        $request->setVisitor($validateCarVisitor);

        /*** @var $response ValidateCarResponse */
        $response = $this->execute($request);

        return $response;
    }

    /**
     * 新车备案
     * @return void
     */
    public function newVehicleRegistration(PremiumInquiryVisitor $premiumInquiryVisitor)
    {
    }
}
